package com.hongkuncheng.cms.freemaker.string;

import freemarker.template.TemplateMethodModelEx;
import freemarker.template.TemplateModelException;
import org.springframework.stereotype.Component;
import java.util.List;

@Component
public class ClearStringBrMethod implements TemplateMethodModelEx {

    @Override
    public Object exec(List args) throws TemplateModelException {
        Object object = args.get(0);
        return object == null ? null : object.toString().replaceAll("<br/>"," ");
    }

}
